// 采样人员

import request from '@/utils/request'

// 采样人员数量
export function getPersonCount(params) {
  return request({
    url: '/baseTrace/employee.do?action=list&type=fastCheckPerson',
    method: 'post',
    params
  })
}

// 设备管理数量
export function getEquipmentCount(params) {
  return request({
    url: '/baseTrace/equipment.do?action=list',
    method: 'post',
    params
  })
}

// 采样人员列表
export function getPerson(params) {
  return request({
    url: '/baseTrace/employee.do?action=list&type=fastCheckPerson',
    method: 'post',
    params
  })
}

// 设备列表
export function getEquipment(params) {
  return request({
    url: '/baseTrace/equipment.do?action=list',
    method: 'post',
    params
  })
}

// 采样人员 详情
export function getPersonDetail(id) {
  return request({
    url: '/baseTrace/employee.do?action=get&id=' + id,
    method: 'post'
  })
}

// 设备 详情
export function getEquipmentDetail(id) {
  return request({
    url: '/baseTrace/equipment.do?action=get&id=' + id,
    method: 'post'
  })
}
// 启用或禁用-人员
export function enableOrDisable(id) {
  return request({
    url: '/baseTrace/employee.do?action=enableOrDisable&id=' + id,
    method: 'post'
  })
}

// 批量启用或禁用-人员
export function enableOrDisableOfBatch(idList) {
  return request({
    url: '/baseTrace/employee.do?action=batchEnableOrDisable&idList=' + idList,
    method: 'post'
  })
}

// 批量启用或禁用-设备
export function enableOrDisableOfEquipment(idList) {
  return request({
    url: '/baseTrace/equipment.do?action=batchEnableOrDisable&idList=' + idList,
    method: 'post'
  })
}

// 新增或编辑 采样人员
export function saveOrUpdate(params) {
  return request({
    url: '/baseTrace/employee.do?action=saveOrUpdate',
    method: 'post',
    params
  })
}

// 新增或更新 设备
export function saveOrUpdateEquipment(params) {
  return request({
    url: '/baseTrace/equipment.do?action=saveOrUpdate',
    method: 'post',
    params
  })
}

// getUser
export function getUser() {
  return request({
    url: '/org/user.do?action=getUser',
    method: 'post'
  })
}

// get roleName
export function getRoleName(userId) {
  return request({
    url:
      '/baseTrace/employee.do?action=list&type=fastCheckPerson&userId=' +
      userId,
    method: 'post'
  })
}
